package com.itliuhouse.success.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.itliuhouse.success.enums.UserStatus;
import lombok.Data;

import java.time.LocalDateTime;
@Data
//这里要使用 autoResultMap 进行自动转化  自动转化为Map  发现返回数据的时候 自动转化为Map

@TableName(value = "user" , autoResultMap = true)
public class User {
    private Long id;
    private String username;
    private String password;
    private String phone;
    //使用状态(1:正常  2：冻结)
    private UserStatus status;
    private Integer balance;
    //详细信息  将User类的info字典修改为UserInfo类型,并生命类型处理器
    @TableField(typeHandler = JacksonTypeHandler.class)
    private UserInfo info;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
